package com.hotel.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author Lin
 * @since 2022-06-13
 */
@Data
@Accessors(chain = true)
@TableName("orders")
public class Orders{

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 订单号
     */
    @TableField("number")
    private String number;

    /**
     * 订单状态 1待付款，2待派送，3已派送，4已完成，5已取消
     */
    @TableField("status")
    private Integer status;

    /**
     * 下单用户
     */
    @TableField("user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /**
     * 地址id
     */
    @TableField("address_book_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long addressBookId;

    /**
     * 下单时间
     */
    @TableField("order_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh",timezone ="GMT+8")
    private Date orderTime;

    /**
     * 结账时间
     */
    @TableField("checkout_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh",timezone ="GMT+8")
    private Date checkoutTime;

    /**
     * 支付方式 1微信,2支付宝
     */
    @TableField("pay_method")
    private Integer payMethod;

    /**
     * 实收金额
     */
    @TableField("amount")
    private BigDecimal amount;

    /**
     * 数量
     */
    @TableField("skuCount")
    private Integer skuCount;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;


    /**
     * 用户名字
     */
    @TableField(value = "nickName",exist = false)
    private String nickName;

    /**
     * 收货人
     */
    @TableField(value = "consignee",exist = false)
    private String consignee;

    /**
     * 电话
     */
    @TableField(value = "phone",exist = false)
    private String phone;

    /**
     * 省名字
     */
    @TableField(value = "province_name",exist = false)
    private String provinceName;

    /**
     * 城市名字
     */
    @TableField(value = "city_name",exist = false)
    private String cityName;

    /**
     * 地区名称
     */
    @TableField(value = "district_name",exist = false)
    private String districtName;

    /**
     * 细节
     */
    @TableField(value = "detail",exist = false)
    private String detail;



}
